<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>  
	<body>
		<button type="button">点击停止定时器</button>
		<script type="text/javascript">
			var btn = document.querySelector("button");
			var time1 = setTimeout(function() {
				console.log("explod");
			}, 5000);
			btn.addEventListener("click", function() {
				clearTimeout(time1);
			})
		</script>
	</body>
</html>
